#include "CodingConvert.h"
#include "Share.h"
#include <Windows.h>

wchar_t *CharToWchar(const char* c)   
{   
	static DataBuffer<wchar_t> temp_string;
    int len = MultiByteToWideChar(CP_ACP,0,c,strlen(c),NULL,0);   
    wchar_t *m_wchar=temp_string.getBuffer(len+1);  
    MultiByteToWideChar(CP_ACP,0,c,strlen(c),m_wchar,len);   
    m_wchar[len]='\0';   
    return m_wchar;   
}

char *WcharToChar(const wchar_t *wc){
	static DataBuffer<char> temp_string;
    int len= WideCharToMultiByte(CP_ACP,0,wc,wcslen(wc),NULL,0,NULL,NULL);   
    char *m_char=temp_string.getBuffer(len+1);  
    WideCharToMultiByte(CP_ACP,0,wc,wcslen(wc),m_char,len,NULL,NULL);   
    m_char[len]='\0';   
    return m_char;   
}